import QtQuick 2.6
import Qt.labs.controls 1.0
import QtQuick.XmlListModel 2.0
import QtQuick.Layouts 1.1
import "../template" as Tm
Tm.Navigator {
    id: nav
    property string uid: ""
    property int times: 1

    ListView{
        id: listView
        anchors.fill: parent
        delegate: ItemDelegate{
            width: listView.width
            height: implicitHeight * 1.5
            ColumnLayout {
                anchors.fill: parent
                anchors.margins: 9
                Label {
                    text: name + (passed == -1 ? "通过" : "未通过")
                }
                Label {
                    text: description
                }
            }
        }

        model:    XmlListModel {
            id: xmlModel
            source: http.build("/test/record.xml?t=r", {uid: nav.uid, times: nav.times})
            query: "/testrcs/testrc"

            XmlRole { name: "name"; query: "test/display/string()" }
            XmlRole { name: "passed"; query: "passed/string()" }
            XmlRole { name: "description"; query: "description/string()" }
        }
    }
}
